package com.hl.unittestlearn.http;

import com.hl.unittestlearn.http.bean.LoginResult;

import rx.Observable;

/**
 * Created by Administrator on 2016/12/28 0028.
 */

public class APIServiceManager implements APIService{
    private static APIServiceManager Instance;
    public static final String BASE_URL = "http://10.88.100.141:8888/";


    private APIService apiService;

    public static APIServiceManager initAPIManager(APIService apiService)
    {
        if (Instance == null)
        {
            synchronized (APIServiceManager.class)
            {
                if (Instance == null)
                {
                    Instance = new APIServiceManager();
                    Instance.apiService = apiService;
                }
            }
        }

        return Instance;
    }

    @Override
    public Observable<LoginResult> login(String userName, String password)
    {
        return apiService.login(userName,password);
    }
}
